<template>
	<view class="com-a">
		<view class="title">
			子组件A
		</view>
		<view class="value">
			父组件传进来的值：<text style="color: red;">{{value1}}</text>
		</view>
		<button @click="sendData()">传值给CompB组件</button>
	</view>
</template>

<script>
	export default {
		name:"comA",
		props:{
			value1:{
				type:String
			},
		},
		data() {
			return {
				intent:"123",
			};
		},
		methods:{
			sendData(){
				uni.$emit('getIntent',this.intent);
				console.log(this.intent);
			}

		}

	}
</script>

<style>
.com-a{
	width: 90%;
	background-color: orange;
	padding-top: 20rpx;
	padding-bottom: 20rpx;
}

.title{
	width: 100%;
	display: flex;
	justify-content: center;
	font-weight: bold;
	margin-bottom: 20rpx;
}
.value{
	margin-bottom: 20rpx;
}
button{
	width: 60%;
	background-color: #00aaff;
}
</style>